<?php

namespace App\Model\Es;

use EasySwoole\Component\Singleton;

use Elasticsearch\ClientBuilder;

class EsClient
{

    use Singleton;

    public $esClient = null;
    
    private function __construct()
    {
        $this->esClient = ClientBuilder::create()->setHosts(['127.0.0.1:9200'])->build();
    }

    public function __call($name,$arguments)
    {
        return $this->esClient->$name(...$arguments);
    }

}